<?php
/**
 * Created by PhpStorm.
 * User: Martin.Wu
 * Date: 2020/5/8
 * Time: 11:12
 *
 **/
namespace common\strategy;


/**
 * 策略工厂类
 */
class StrategyFactory
{
    private $strategyMode;

    /**
     * 初始时，传入具体的策略对象
     * @param $mode
     */
    public function __construct($mode)
    {
        $this->strategyMode = $mode;
    }

    /**
     * @param $data
     * @return mixed
     *
     * 获取执行结果
     */
    public function get($data)
    {
        return $this->strategyMode->doAction($data);
    }
}
